package com.driving.single.common.coach.service.impl;

import com.driving.single.common.coach.service.CommonCoachClassesService;
import com.driving.single.common.domain.TbCoachClasses;
import com.driving.single.common.mapper.TbCoachClassesMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

@Service
public class CommonCoachClassesServiceImpl implements CommonCoachClassesService {
    @Autowired
    private TbCoachClassesMapper tbCoachClassesMapper;

    @Override
    public List<TbCoachClasses> selectCoachClassesByCoachId(Long coachId) {
        Example example = new Example(TbCoachClasses.class);
        example.setOrderByClause("`sort_order` ASC");
        example.createCriteria().andEqualTo("coachId", coachId);
        return this.tbCoachClassesMapper.selectByExample(example);
    }
}
